<template>
    <div class="app-container">
        <div class="wrapper">
            <h4>重大工程设施数据</h4>
            <el-row class="row-bgs" justify="center">
                <el-col :span="8">
                    <div class="buildVulner" @click="importParmsClick('buildVulner')"></div>
                </el-col>
                <el-col :span="8">
                    <div class="brickStructure" @click="importParmsClick('brickStructure')"></div>
                </el-col>
                <!-- <el-col :span="8">
                    <div class="reinforConcrete" @click="importParmsClick('reinforConcrete')"></div>
                </el-col> -->
            </el-row>

            <!--<el-dialog v-model="dialogVisible" title="导入数据" width="30%">
                <div class="downloadModel">
                    &lt;!&ndash; 下载导入模板{{ downloadInfo.fileName }} &ndash;&gt;
                    下载导入模板<span  @click="importTemplate">{{ downloadFileName }}</span>
                </div>

                <el-upload ref="uploadRef" :action="uploadFileUrl" :before-upload="beforeUpload"
                    :before-remove="beforeRemove" :on-success="uploadSuccess" :on-error="uploadError"
                    :file-list.sync="fileList" :headers="headers" :multiple="false" :limit="1" :auto-upload="false">
                    <el-button type="primary" class="icon-Angle-upload">
                        选择本地文件
                    </el-button>
                </el-upload>

                <template #footer>
                    <span class="dialog-footer">
                        <el-button size="medium" @click="cancleUpload">取 消</el-button>
                        <el-button size="medium" type="primary" @click="submitUpload">
                            确定
                        </el-button>
                    </span>
                </template>
            </el-dialog>-->
        </div>
      <!--上传面板-->
      <el-dialog v-model="dialogVisible" :title="uploadTitle" width="380px">
        <div v-if="dialogVisible" class="new-uploadDiv">
          <el-form :model="uploadParams" ref="ruleFormRef" :rules="rules" label-position="right" label-width="82px">
            <el-form-item label="省" prop="province">
              <el-select v-model="uploadParams.province" placeholder="请选择" @change="chooseProvince" clearable value-key="name">
                <el-option v-for="item in provinceData" :key="item.id" :label="item.name" :value="item">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="市" prop="city">
              <el-select v-model="uploadParams.city" placeholder="请选择" @change="chooseCity" clearable value-key="name">
                <el-option v-for="item in cityData" :key="item.id" :label="item.name" :value="item">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="区/县" prop="county">
              <el-select v-model="uploadParams.county" :disabled="uploadParams.dataType === '房屋抗震能力分区图'"
                         placeholder="请选择" @change="chooseCounty" clearable value-key="name">
                <el-option v-for="item in areaData" :key="item.id" :label="item.name" :value="item">
                </el-option>
              </el-select>
            </el-form-item>
            <!--<el-form-item label="数据类型" prop="dataType">
              <el-select v-model="uploadParams.dataType" placeholder="请选择" clearable value-key="name">
                <el-option v-for="item in dataTypeInfoArray" :key="item.code" :label="item.name" :value="item.name">
                </el-option>
              </el-select>
            </el-form-item>-->
            <el-form-item label="文件类型" prop="fileType">
              <el-select v-model="uploadParams.fileType" placeholder="请选择" @change="changeFileType" clearable value-key="name" disabled>
                <el-option v-for="item in fileType" :key="item.code" :label="item.name" :value="item.code">
                </el-option>
              </el-select>
            </el-form-item>
          </el-form>
          <div style="display: flex;">
            <div>
              <div class="new-fileBtn">
                <template v-if="uploadParams.fileType=='1'">
                  <input type="file" @change="uploadFileChange" style="width: 70px;" id="spaceData-button-selectfile" multiple="multiple" accept=".shp,.dbf,.prj,.sbn,.sbx,.shp.xml,.shx,.cpg" />
                </template>
                <template v-if="uploadParams.fileType=='2'">
                  <input type="file" @change="uploadFileChange" style="width: 70px;" id="excel-button-selectfile" accept=".xls,.xlsx" />
                </template>
              </div>
              <div class="new-fieldInfoBtn" v-if="uploadParams.dataType!='重大工程历史震害'">
                <a @click="showFieldDialog"><h5>字段说明</h5></a>
              </div>
              <div v-if="uploadParams.fileType=='2'" class="new-downloadFileBtn">
                <a @click="importTemplate" :title="'下载Excel导入模板：'+downloadFileName"><h5>下载模板</h5></a>
              </div>
            </div>
            <div style="margin-left: 12px;">
              <div class="new-filesTextArea">
                <el-input type="textarea" :rows="8" :placeholder="uploadParams.dataType=='重大工程历史震害'?'':'导入多个文件时，文件名须相同'" v-model="textarea" readonly></el-input>
              </div>
            </div>
          </div>
          <div style="margin-top:10px;">
            <el-button @click="uploadFileClick" type="primary">上传</el-button>
            <el-button @click="showHideUploadDiv(false)" style="float: right;">关闭</el-button>
          </div>
        </div>
        <!--字段说明-->
        <FieldInfoDialog v-if="fieldInfoVisible==true"
                         :dataType="uploadParams.dataType"
                         @closeFieldInfoDialog="fieldInfoVisible=false"
        ></FieldInfoDialog>
      </el-dialog>
      <!--覆盖的数据版本-->
      <el-dialog v-model="dialogCover" title="请选择要覆盖的数据版本" width="700px" append-to-body :show-close="false"
        :close-on-click-modal="false">
        <h4></h4>
        <el-table class="listTables" ref="multipleTableRef" :data="dataList1" stripe style="width: 100%"
          @selection-change="handleSelectionChange2" @select="handleSelectClick2">
          <el-table-column type="selection" width="55" />
          <el-table-column prop="versionCode" label="版本号" align="center" width="200"></el-table-column>
          <el-table-column prop="createTime" label="上传时间" align="center" width="110"></el-table-column>
          <el-table-column prop="fileName" label="文件名称" align="center" show-overflow-tooltip></el-table-column>
          <el-table-column label="区域" align="center" show-overflow-tooltip>
            <template #default="{ row }">
              <span>{{ row.province }}-{{ row.city }}-{{ row.county }}</span>
            </template>
          </el-table-column>
        </el-table>
        <template #footer>
          <div class="dialog-footer">
            <el-button type="primary" :disabled="!coverId1" @click="queryCover">确定覆盖</el-button>
            <el-button @click="uploadData">直接上传</el-button>
          </div>
        </template>
      </el-dialog>
    </div>
</template> 
  
<script setup>
import { ref, onMounted, reactive } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
// import { uploadHpInformation, uploadRdInformation, uploadGstInformation } from "@/api/importData/majorEngineerFac.js";
import { repeatData,getVersionCode,deleteByTypeAndVersionId,getByRange, } from "@/api/map/disasterDataManagement/lifelineSystemInfo.js";
import { getToken } from "@/utils/auth";
//字段说明
import FieldInfoDialog from '@/map/disasterDataManagement/maintainData/majorEngineerFacInfo/fieldInfoDialog.vue';
import { getProvince, getChildArea } from "@/api/system/division";
import { uploadShp,uploadExcel } from "@/api/map/disasterDataManagement/majorEngineerFacInfo.js";
import { upLoadFile, downLoadFile, deleteFile } from "@/api/system/attachFile";

const { proxy } = getCurrentInstance();
const baseURL = import.meta.env.VITE_APP_BASE_API
const headers = ref({ token: "token " + getToken() });
const uploadRef = ref()
const rules = reactive({
      province: [{ required: true, message: '请输入省', trigger: 'blur' },],
      city: [{ required: true, message: '请输入市', trigger: 'blur' },],
      county: [{ required: true, message: '请输入区县', trigger: 'blur' },],
    })
const dialogVisible = ref(false)
const cancleUpload = (res) => {
    dialogVisible.value = false
}
const submitUpload = (res) => {
    dialogVisible.value = false
    uploadRef.value.submit()
}


// const downloadFileType = ref('buildVulner')
const uploadFileUrl = ref(baseURL + "/domeFacilities/uploadHpInformation"); // 上传地址
const fileList = ref([]);


//下载标题切换

// const downloadInfo = reactive({   // 方式1 用reactive
//     fileName: 'hello',
// })
const downloadFileName = ref('重大工程历史震害信息模板.xlsx') // 方式2
const importParmsClick = (val) => {
    // downloadFileType.value = val;
    fileList.value = [];
    switch (val) {
        case 'buildVulner':
            dialogVisible.value = true
            downloadFileName.value = '重大工程历史震害信息模板.xlsx'
            // uploadFileUrl.value = baseURL + "/domeFacilities/uploadHpInformation"
            uploadParams.value.dataType = "重大工程历史震害";//数据类型
            uploadTitle.value = "导入重大工程历史震害信息";//上传窗口标题
            //文件类型
            uploadParams.value.fileType = "2";
            break;
        case 'brickStructure':
            dialogVisible.value = true
            downloadFileName.value = '水库大坝信息模板.xlsx'
            // uploadFileUrl.value = baseURL + "/domeFacilities/uploadRdInformation"
            uploadParams.value.dataType = "水库大坝";//数据类型
            uploadTitle.value = "导入水库大坝信息";//上传窗口标题
            //文件类型
            uploadParams.value.fileType = "1";
            break;
        case 'reinforConcrete':
            dialogVisible.value = true
            downloadFileName.value = '燃气-储气罐.xlsx'
            // uploadFileUrl.value = baseURL + "/domeFacilities/uploadGstInformation"
            uploadParams.value.dataType = "燃气-储气罐";//数据类型
            uploadTitle.value = "导入燃气-储气罐信息";//上传窗口标题
            break;
        default:
            break;
    }

}

// 模板下载
function importTemplate() {
    proxy.download("/base/product/downloadExcel", {
        fileName: downloadFileName.value
    }, downloadFileName.value);
};

//文件上传
const beforeRemove = () => {
    fileList.value = [];
};

const beforeUpload = (file) => {
    const fileSize = file.size / 1024 / 1024;
    if (fileSize > 200) {
        $message.error('文件大小不能超过200M!');
        return false;
    }
    const fileReg = /.xls|.xlsx/;
    if (!fileReg.test(file.name)) {
        $message.error('请选择.xls .xlsx格式文件');
        return false;
    }
    return true;
};
const uploadSuccess = (response, uploadFile, uploadFiles) => {
    proxy.$modal.msgSuccess("上传文件成功");
}
const uploadError = (response, uploadFile, uploadFiles) => {
    proxy.$modal.msgError("上传文件失败");
}

onMounted(() => {
  getProvinceData();
});

//zyt--修改start
const data = reactive({
  uploadParams: {
    province: "",
    city: "",
    county: "",
    type: "",//上传文件类型
    dataType:"",//数据类型
    fileType:"1",//文件类型：1Shp文件 2Excel文件
  },
});
const {
  uploadParams,
} = toRefs(data);

const loading = ref(false);
const provinceData = ref([]); //省
const cityData = ref([]); //市
const areaData = ref([]); //区、县
const uploadTitle = ref("");//上传dialog标题
//文件类型
const fileType = ref([
  {code:"1",name:"Shp文件"},
  {code:"2",name:"Excel文件"},
]);
//数据类型
const dataTypeInfoArray = ref([
  {code:"16",name:"重大工程历史震害"},
  {code:"17",name:"水库大坝"},
]);
const textarea = ref("");//上传文件只读显示文本框
const minList = ref([]);//要上传的文件的后缀名数组
const nameList = ref([]);//要上传的文件的文件名数组
/** 获取省列表 */
function getProvinceData() {
  getProvince().then((response) => {
    // console.log("省response.data");
    // console.log(response.data);
    provinceData.value = response.data;
  });
}
//选择省
function chooseProvince(value) {
  uploadParams.value.city = null;
  uploadParams.value.county = null;
  uploadParams.value.province = value.name;
  cityData.value = [];
  areaData.value = [];
  getChildArea(value.id).then(response => {
    cityData.value = response.data;
  });
}
//选择市
function chooseCity(value) {
  uploadParams.value.city = value.name;
  uploadParams.value.county = null;
  areaData.value = [];
  getChildArea(value.id).then((response) => {
    areaData.value = response.data;
  });
}
//选择区县
function chooseCounty(value) {
  uploadParams.value.county = value.name;
}
const fieldInfoVisible = ref(false);//是否显示字段说明
//显示字段说明dialog
function showFieldDialog(){
  if(uploadParams.value.dataType!=null && uploadParams.value.dataType!=""){
    fieldInfoVisible.value = true;
  }else{
    alertMsg("请先选择数据类型!");
  }
}

//选择文件类型
function changeFileType() {
  //let selectfile = document.getElementById("spaceData-button-selectfile");
  //Shp文件
  //selectfile.setAttribute("accept",".shp,.dbf,.prj,.sbn,.sbx,.shp.xml,.shx,.cpg");
  let fileType = uploadParams.value.fileType;//文件类型：1Shp文件 2Excel文件
  minList.value = [];
  nameList.value = [];
  textarea.value = "";
}

//选择文件
function uploadFileChange(){
  let uploadinputFiles = null;
  let fileType = uploadParams.value.fileType;//文件类型：1Shp文件 2Excel文件
  if(fileType==null || fileType===""){
    alertMsg("请选择文件类型!");
    return;
  }
  if(fileType=="1"){
    uploadinputFiles = document.getElementById("spaceData-button-selectfile").files;
  }else if(fileType=="2"){
    uploadinputFiles = document.getElementById("excel-button-selectfile").files;
  }
  minList.value = [];
  nameList.value = [];
  let text = "";
  for (let i = 0; i < uploadinputFiles.length; i++){
    // console.log("uploading: " + uploadinputFiles[i].name);
    text += uploadinputFiles[i].name+"\n";
    // 获取这个文件的后缀名
    minList.value.push(uploadinputFiles[i].name.slice(uploadinputFiles[i].name.length-3,uploadinputFiles[i].name.length));
    nameList.value.push(uploadinputFiles[i].name.split(".")[0]);
  }
  textarea.value = text;
}
const dialogCover = ref(false); // 覆盖开关
const uploadData = () => {
  dialogCover.value = false;
  //上传保存数据
  const query = {
    ...coverObj.value,
    cover: '0',
    id: ''
  }
  let fileType = uploadParams.value.fileType;//文件类型：1Shp文件 2Excel文件
  if (fileType == "1") {
    proxy.$modal.loading('正在上传，请稍等...')
    uploadShp(query).then((response) => {
      proxy.$modal.closeLoading();
      nextTick(() => {
        let msg = response.data;
        loading.value = false;
        showHideUploadDiv(false);//隐藏上传面板
        ElMessageBox.alert(msg, '系统信息', {
          confirmButtonText: '确认',
          type: 'success'
        });
      });
    }).catch(err => {
      proxy.$modal.closeLoading();
      loading.value = false;
    });
  } else {
    proxy.$modal.loading('正在上传，请稍等...')
    let uploadinput = null;
    if(fileType=="1"){
      uploadinput = document.getElementById("spaceData-button-selectfile");
    }else if(fileType=="2"){
      uploadinput = document.getElementById("excel-button-selectfile");
    }
    let formData = new FormData();
    formData.append("fileIds", coverObj.value.fileIds);
    formData.append("cover", '1');
    formData.append("province", coverObj.value.province);
    formData.append("city", coverObj.value.city);
    formData.append("id", coverId1.value);
    formData.append("county", coverObj.value.area);
    formData.append('file', uploadinput.files[0]);
    uploadExcel(formData).then((response) => {
      proxy.$modal.closeLoading();
      dialogCover.value = false;
      nextTick(() => {
        let msg = response.data;
        loading.value = false;
        showHideUploadDiv(false);//隐藏上传面板
        ElMessageBox.alert(msg, '系统信息', {
          confirmButtonText: '确认',
          type: 'success'
        });
      });
    }).catch(err => {
      proxy.$modal.closeLoading();
      loading.value = false;
    });
  }
}
// 覆盖确认
const queryCover = () => {
  //上传保存数据
  loading.value = true;
  // selectType.value = queryParams.value.dataType;//数据类型
  let fileType = uploadParams.value.fileType;//文件类型：1Shp文件 2Excel文件
  if (fileType == "1") {
    proxy.$modal.loading('正在上传，请稍等...')
    uploadShp({ ...coverObj.value, id: coverId1.value, cover: '1' }).then((response) => {
      dialogCover.value = false;
      proxy.$modal.closeLoading();
      nextTick(() => {
        let msg = response.data;
        loading.value = false;
        showHideUploadDiv(false);//隐藏上传面板
        ElMessageBox.alert(msg, '系统信息', {
          confirmButtonText: '确认',
          type: 'success'
        });
      });
    }).catch(err => {
      proxy.$modal.closeLoading();
      loading.value = false;
    });
  } else {
    proxy.$modal.loading('正在上传，请稍等...')
    let uploadinput = null;
    if(fileType=="1"){
      uploadinput = document.getElementById("spaceData-button-selectfile");
    }else if(fileType=="2"){
      uploadinput = document.getElementById("excel-button-selectfile");
    }
    let formData = new FormData();
    formData.append("fileIds", coverObj.value.fileIds);
    formData.append("cover", '1');
    formData.append("province", coverObj.value.province);
    formData.append("city", coverObj.value.city);
    formData.append("id", coverId1.value);
    formData.append("county", coverObj.value.area);
    formData.append('file', uploadinput.files[0]);
    uploadExcel(formData).then((response) => {
      proxy.$modal.closeLoading();
      dialogCover.value = false;
      nextTick(() => {
        let msg = response.data;
        loading.value = false;
        showHideUploadDiv(false);//隐藏上传面板
        ElMessageBox.alert(msg, '系统信息', {
          confirmButtonText: '确认',
          type: 'success'
        });
      });
    }).catch(err => {
      proxy.$modal.closeLoading();
      loading.value = false;
    });
  }
}
// 获取选中当前行数据
const handleSelectionChange2 = (checked) => {
  selectionChecked1.value = checked;
  if (selectionChecked1.value.length == 0) {
    coverId1.value = undefined;
  } else {
    coverId1.value = checked[0].id;
  }
}
const dataList1 = ref([]);// 可覆盖版本数据
const coverObj = ref({});// 覆盖参数
const selectionChecked1 = ref([])
const coverId1 = ref();
//上传文件
function uploadFileClick(){
  proxy.$refs['ruleFormRef'].validate((valid, fields)=>{
    if(valid){
      let uploadinput = null;
      let fileType = uploadParams.value.fileType;//文件类型：1Shp文件 2Excel文件
      if(fileType==null || fileType===""){
        alertMsg("请选择文件类型!");
        return;
      }
      if(fileType=="1"){
        uploadinput = document.getElementById("spaceData-button-selectfile");
      }else if(fileType=="2"){
        uploadinput = document.getElementById("excel-button-selectfile");
      }
      if (uploadinput.value == "") {
        alertMsg("上传前请先选择文件!");
        return;
      }
      let dataType = uploadParams.value.dataType;//数据类型
      if(fileType=="1"){
        if(!judgeIsOnce(minList.value)){
          alertMsg('上传数量限制:.dbf、.prj、.shp、.shx、.cpg文件各1个;.sbn、.sbx、.shp.xml文件至多一个。');
          return;
        }else if(!judgeName(nameList.value)){
          alertMsg("文件名请保持一致！");
          return;
        }
      }else if(fileType=="1"){
        if(!judgeExcel(minList.value)){
          alertMsg('上传数量限制:.xls或.xlsx文件1个');
          return;
        }
      }
      let province = uploadParams.value.province;
      let city = uploadParams.value.city;
      let area = uploadParams.value.county;
      if(province==null){
        province = "";
      }
      if(city==null){
        city = "";
      }
      if(area==null){
        area = "";
      }
      if(dataType==null){
        dataType = "";
      }
      if(dataType===""){
        alertMsg("请选择数据类型!");
        return;
      }
      const fileFormData = new FormData();
      // 因为要传一个文件数组过去，所以要循环append
      for(let i = 0; i < uploadinput.files.length; i++){
        //fileFormData.append('file', uploadinput.files[i].raw)
        fileFormData.append('file', uploadinput.files[i]);
      }
      let formData = new FormData();
      //获取查询数据类型
      let type = getSelectTypeNumStr(dataType);
      formData.append("type", type);
      formData.append("province", province);
      formData.append("city", city);
      formData.append("county", area);
      loading.value = true;
      // console.log("formData");
      // console.log(formData);
      let fileIds = "";//上传附件id列表
      // if(fileType=="1"){//Shp文件
        // 上传文件到附件表
        upLoadFile(fileFormData).then(res => {
          // console.log("上传文件成功")
          if (res.code==200) {
            let resultArr = res.data;
            // console.log(res.data);
            for(let i=0;i<resultArr.length;i++){
              if(i>0){
                fileIds += ",";
              }
              fileIds += resultArr[i].attachId;
            }
            // proxy.$modal.msgSuccess("上传文件成功");
            //获取查询数据类型
            let type = getSelectTypeNumStr(dataType);
            loading.value = true;
            coverObj.value = { fileIds: fileIds, type: type, province: province, city: city, county: area,bridgeType:'0' };
            repeatData({ name: fileType == '2' ? textarea.value.split('.')[0] : undefined, fileIds: fileIds, type: type, province: province, city: city, county: area,bridgeType:'0' }).then(res => {
                const { code, data } = res;
                if (code == 200) {
                  if (data.length == 0) {
                    // console.log("formData");
                    // console.log(formData);
                    if(fileType=="1"){//Shp文件
                      // formData.append("file", null);
                      let params = {
                        fileIds: fileIds,
                        cover: '0',
                        province: province,
                        city: city,
                        id: '',
                        county: area
                      }
                      //上传保存数据
                      uploadShp(params).then((response) => {
                        nextTick(() => {
                          let msg = response.data;
                          loading.value = false;
                          ElMessageBox.alert(msg, '系统信息', {
                            confirmButtonText: '确认',
                            type: 'success'
                          });
                        });
                      }).catch(err => {
                        loading.value = false;
                      });
                    }else if(fileType=="2"){//excel文件
                      let formData = new FormData();
                      formData.append("fileIds", fileIds);
                      formData.append("cover", '0');
                      formData.append("province", province);
                      formData.append("city", city);
                      formData.append("id", '');
                      formData.append("county", area);
                      formData.append('file', uploadinput.files[0]);
                      //上传保存数据
                      uploadExcel(formData).then((response) => {
                        nextTick(() => {
                          let msg = response.data;
                          loading.value = false;
                          ElMessageBox.alert(msg, '系统信息', {
                            confirmButtonText: '确认',
                            type: 'success'
                          });
                        });
                      }).catch(err => {
                        loading.value = false;
                      });
                    }
                  }else{
                    loading.value = false;
                    dataList1.value = data;
                    dialogCover.value = true;
                  }
                }else{
                  loading.value = false;
                }
            })
          }else{
            proxy.$modal.msgError("上传文件失败");
          }
        });
      // }
    }
  })
}

const showHideUploadDiv = (bool)=>{//显示|隐藏上传面板
  dialogVisible.value = false;//隐藏dialog
  //清空上传参数
  clearUploadParams();
}

//清空上传参数
function clearUploadParams(){
  uploadParams.value.province = null;
  uploadParams.value.city = null;
  uploadParams.value.county = null;
  uploadParams.value.dataType = null;
  textarea.value = "";
}

//警告消息
function alertMsg(msg){
  proxy.$modal.msgWarning(msg);
}

//校验Excel文件类型
function judgeExcel(list) {
  let xls = 0,xlsx = 0;
  for(let i=0;i<list.length;i++){
    let item = list[i];
    if(item == 'xls') xls++;
    if(item == 'xlsx') xlsx++;
  }
  if(list.length==1 && (xls == 1 && xlsx === 0) || (xls === 0 && xlsx == 1)) return true;
  else return false;
}
//校验Shp文件类型
function judgeIsOnce(list) {
  // ["dbf","prj","shp","shx","cpg"];
  let dbf = 0,prj = 0,shp = 0,shx = 0,cpg = 0,sbn = 0,sbx = 0,xml = 0;
  for(let i=0;i<list.length;i++){
    let item = list[i];
    if(item == 'dbf') dbf++;
    if(item == 'prj') prj++;
    if(item == 'shp') shp++;
    if(item == 'shx') shx++;
    if(item == 'cpg') cpg++;
    if(item == 'sbn') sbn++;
    if(item == 'sbx') sbx++;
    if(item == 'xml') xml++;
  }
  if(dbf == 1 && prj == 1 && shp == 1 && shx == 1 && cpg == 1 && sbn < 2 && sbx < 2 && xml < 2) return true;
  else return false;
}
//校验Shp文件名称
function judgeName(list) {
  let name = list[0];
  let result = list.filter(function (item) {
    return item == name;
  })
  if(result.length == list.length) return true;
  else return false;
}

//获取数据类型序号
function getSelectTypeNumStr(type){
  let code = null;
  let dataTypeArr = dataTypeInfoArray.value;
  for(let i=0;i<dataTypeArr.length;i++){
    if(dataTypeArr[i].name==type){
      code = dataTypeArr[i].code;
      break;
    }
  }
  return code;
}

//zyt--修改end
</script>
  
<style lang="scss" scoped>
.wrapper {
    position: relative;

    h4 {
        font-size: 20px;
        font-weight: bold;
        color: #107ce5;
        text-align: center;
    }

    .row-bgs {
        width: 100%;
        display: flex;
        margin-bottom: 30px;

        &:last-child {
            margin-bottom: 0;
        }

        div {
            width: 360px;
            height: 150px;
            display: flex;
            justify-content: center;
        }

        .buildVulner {
            background: url("../../../../assets/importImages/zdgc.png");
        }

        .brickStructure {
            background: url("../../../../assets/importImages/skdb.png");
            margin: 0 20px;
        }

        .reinforConcrete {
            background: url("../../../../assets/importImages/rqcqg.png");
        }
    }

    .downloadModel {
        font-size: 16px;
        line-height: 60px;

        span {
            color: #107ce5;
            cursor: pointer;
        }
    }
}

//上传面板
.new-uploadDiv{
  padding:20px;
}
.new-fileBtn {

}
.new-fieldInfoBtn{
  color:#107ce5;
  text-align: right;
}
.new-downloadFileBtn {
  color:#107ce5;
  text-align: right;
}
.new-filesTextArea{
  width: 216px;
}
</style>
